﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Project_2._2.Models;
using Project_2._2.ViewModels;

namespace Project_2._2.Controllers
{
    public class SearchController : Controller
    {
        //
        // GET: /Search/
        private QuanLyThueXeEntities db = new QuanLyThueXeEntities();
        public ActionResult SearchNomarl(FormCollection col)
        {
            string key = col["SearchString"].ToString();

            var car = from xe in db.Xes
                       where xe.TenXe.Contains(key)
                       select xe;

            return View(car);

            //var qc = from p in db.QuangCaos where p.isDelete == false select p;

            //if (!String.IsNullOrEmpty(searchString))
            //{
            //    qc = qc.Where(s => s.TenCtyQuangCao.Contains(searchString));
            //}
            //else
            //{
            //    ModelState.AddModelError("", "Không tìm thấy...!");
            //}
            //return View(qc);
        }

        public ActionResult SearchAdvance()
        {
            return View();
        }

    }
}
